---
page_title: "cloudflare_web_analytics_site Resource - Cloudflare"
subcategory: ""
description: |-
  Provides a Cloudflare Web Analytics Site resource.
---

# cloudflare_web_analytics_site (Resource)

Provides a Cloudflare Web Analytics Site resource.

## Example Usage

```terraform
resource "cloudflare_web_analytics_site" "example" {
  account_id   = "f037e56e89293a057740de681ac9abbe"
  zone_tag     = "0da42c8d2132a9ddaf714f9e7c920711"
  auto_install = true
}
```
<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `account_id` (String) The account identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
- `auto_install` (Boolean) Whether Cloudflare will automatically inject the JavaScript snippet for orange-clouded sites. **Modifying this attribute will force creation of a new resource.**

### Optional

- `host` (String) The hostname to use for gray-clouded sites. Must provide only one of `zone_tag`. **Modifying this attribute will force creation of a new resource.**
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
- `zone_tag` (String) The zone identifier for orange-clouded sites. Must provide only one of `host`. **Modifying this attribute will force creation of a new resource.**

### Read-Only

- `id` (String) The ID of this resource.
- `ruleset_id` (String) The ID for the ruleset associated to this Web Analytics Site.
- `site_tag` (String) The Web Analytics site tag.
- `site_token` (String, Sensitive) The token for the Web Analytics site.
- `snippet` (String, Sensitive) The encoded JS snippet to add to your site's HTML page if auto_install is false.

<a id="nestedblock--timeouts"></a>
### Nested Schema for `timeouts`

Optional:

- `create` (String)

## Import

Import is supported using the following syntax:

```shell
$ terraform import cloudflare_web_analytics_site.example <account_id>/<site_tag>
```
